
package ija.model.types;

import ija.xls.notation.DeskCoordinate;
import java.util.Objects;

/**
 *
 * @author Radek Necas, xnecas18
 */
public class FigureRoute {
    
    DeskCoordinate coordinate;
    String text;
    
    public FigureRoute(DeskCoordinate coord, String text) {
        this.coordinate = coord;
        this.text = text;
    }
    
    public void setCoordinate(DeskCoordinate coord) {
        this.coordinate = coord;
    }
    
    public void setText(String newText) {
        this.text = newText;
    }
    
    public DeskCoordinate getCoordinate() {
        return coordinate;
    }
    
    public int getRow() {
        return coordinate.getRow();
    }
    
    public char getColumn() {
        return coordinate.getColumn();
    }
    
    public String getText() {
        return text;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 79 * hash + Objects.hashCode(this.coordinate);
        hash = 79 * hash + Objects.hashCode(this.text);
        return hash;
    }

    @Override
    public boolean equals(Object o) {
        if(o instanceof FigureRoute) {
            FigureRoute r = (FigureRoute) o;
            return ((this.getRow() == r.getRow()) && (this.getColumn() == r.getColumn()));
        }
        else if(o instanceof DeskCoordinate) {
            DeskCoordinate coord = (DeskCoordinate)o;
            return((this.getRow() == coord.getRow()) && (this.getColumn() == coord.getColumn()));
        }
        
        return false;
    }
}
